<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>

  <div id="app"></div>

  <script src="../react-js/react.development.js" crossorigin></script>
  <script src="../react-js/react-dom.development.js" crossorigin></script>
  <script src="../react-js/babel.min.js"></script>

  <script type="text/babel">
    class App extends React.Component {
      constructor() {
        super()

        this.state = {
          names: ['ACE', 'SaBo', 'Luffy', 'long']
        }
      }

      render() {
        return (
          <div>
            <ul>
              {
                this.state.names.map((item, index) => {
                  return (
                    <li 
                      className="item"
                      onClick={ event => { this.handlerItemClick(item, index, event) } }
                    >
                      { item }
                    </li>
                  )
                })
              }
            </ul>
          </div>
        )
      }

      handlerItemClick(it, ix, e) {
        console.log(it, ix, e)
      }

    }

    ReactDOM.render(<App/>, document.getElementById('app'))
  </script>
</body>
</html>